import {request} from "../request";
import {utils} from "../../common/utils";

export function getGsPageInfo({gsClassifyId,enabled,name,num,pageNum,pageSize}){
    return request({
        url: '/adm/gs/query',
        method: 'get',
        params:{
            gsClassifyId,
            enabled,
            name,
            num,
            pageNum,
            pageSize
        }
    })
}

export function addGoods(gs){
    return request({
        url:"/adm/gs/add",
        method:'post',
        data:gs
    })
}

export  function deleteGs(ids){
    let strUrl = utils.joinArrayReqParam(ids,"ids")
    return request({
        url:'/adm/gs/delete' + strUrl,
        method:'delete',
    })
}

export function updateGs(gs){
    return request({
        url: '/adm/gs/update',
        method: 'put',
        data: gs
    })
}

//5、查询是否已经存在有相同编码的物品
export function hasSameCodeGs({id,code}){
    return request({
        url: '/adm/gs/has-same-code-gs',
        method: 'get',
        params:{
            id,
            code
        }
    })
}

//6、获取物品集合
export function getGsList(){
    return request({
        url: '/adm/gs/query2',
        method: 'get'
    })
}


//新的申请记录
export function shengqinggoods(){
    return request({
        url:'/process/gs-py/getAll',
        method:'get',
        params:{}
    })
}

